import $http from '../../../servers/http';
import { Result } from '../../schema/Result';
/* 告警管理-告警消息管理
---------------------------------------------------------------- */
import { AlarmListInfo } from '../../schema/Alarm';

/**告警消息-消息状态变更 */
export const modifyAlarm = (alarmId: string): Promise<Result<null>> => {
  return $http.get({
    url: `/alarmmanage/alarms/${alarmId}/cancelfocus`,
  });
};

/**删除告警消息 */
export const deleteAlarm = (): Promise<Result<null>> => {
  return $http.delete({
    url: `/alarmmanage/alarms`,
  });
};

/**查询告警消息列表 */
export const getAlarmList = (data: {
  pageSize: number;
  pageNo: number;
}): Promise<Result<AlarmListInfo[]>> => {
  return $http.get({
    url: '/alarmmanage/alarms',
    data,
  });
};

/**查询新告警消息总数 */
export const getAlarmFocusCount = (): Promise<Result<null>> => {
  return $http.get({
    url: '/alarmmanage/alarms/focuscount',
  });
};
